package com.th.cash.th2.product

import android.content.Context
import com.lxj.xpopup.core.BottomPopupView
import com.th.resmodel.R
import com.th.resmodel.databinding.PopupPicSelectBinding

class PicSelectPopup(
    context: Context
) : BottomPopupView(context) {

    var clickListener: ((Int) -> Unit)? = null

    override fun getImplLayoutId(): Int {
        return R.layout.popup_pic_select
    }

    override fun onCreate() {
        super.onCreate()

        val bind = PopupPicSelectBinding.bind(popupImplView)

        bind.run {
            bind.ivPicClose.setOnClickListener { dismiss() }
            bind.ivPicAlbum.setOnClickListener {
                dismiss()
                clickListener?.invoke(0)
            }
            bind.ivPicCamera.setOnClickListener {
                dismiss()
                clickListener?.invoke(1)
            }
        }
    }
}